//
//  UIView+Frame.h
//  传智微博
//
//  Created by apple on 15-3-5.
//  Copyright (c) 2015年 apple. All rights reserved.
//

#import <UIKit/UIKit.h>


@class MABaseModel;
@interface UIView (ACT)
@property(nonatomic,strong)MABaseModel *model;
/**《 按钮输出 》**/

@property(nonatomic,copy )void (^buttonBlcok)(id supCell ,id subView ,NSIndexPath *indexPath, id model);
/**《 文本输出 》**/
@property(nonatomic,copy )void (^textBlcok)(NSString *title ,id supCell ,id subView ,NSIndexPath *indexPath, id model);

@property(nonatomic,copy ) void(^layoutBlock)(UIView *view,CGPoint origin,CGSize size,CGPoint center);
/**《 NSIndexPath 》**/
@property(nonatomic,strong)NSIndexPath*indexPath;

@property (nonatomic,strong) NSMutableDictionary * viewConfigDic;
@property (nonatomic,strong) NSMutableDictionary * cellConfigDic;

/**
 *  @brief  找到当前view所在的viewcontroler
 */
@property (readonly,nonatomic) UIViewController *viewController;

/**
 *  @brief  获取最前面的控制器
 */
@property (readonly,nonatomic) UIViewController *topViewController;


-(void)onChangeEditorEndForSub:(id)Sub;

-(void)onClickButtonForSub:(id)Sub;


- (void)addTarget:(id)target
           action:(SEL)action;

/*
 * 判断一个控件是否真正显示在主窗口
 */
- (BOOL)isShowingOnKeyWindow;

/**
 *  添加控件
 *
 *  @param view 控件
 */
-(void)addV:(id)view;
//茯苓
/**
 *  自己添加到父类上
 *
 *  @param supView 父类view
 */
-(void)addInSView:(id)supView;

-(void)onMainSetSubViewFrame:(void(^)(UIView *view,CGPoint origin,CGSize size,CGPoint center))layoutBlock;


-(UIViewController *)currentViewController;
@end

@interface UIView (Line)
//@property (nonatomic,assign) IBInspectable BOOL hasTopLine;
//@property (nonatomic,assign) IBInspectable BOOL hasBottomLine;
//@property (nonatomic,assign) IBInspectable BOOL hasBottomSmallLine;
//@property (nonatomic,assign) IBInspectable BOOL hasLeftLine;
//@property (nonatomic,assign) IBInspectable BOOL hasRightLine;
@end

@interface UIView (Radius)
@property(nonatomic,assign)BOOL isRadius;
-(void)setRadiusType:(UIRectCorner)type Radius:(CGFloat)radius;
@end

@interface UIView (OFView)
@property (nonatomic,assign) IBInspectable  CGFloat cornerRadius;
@property (nonatomic,assign) IBInspectable  CGFloat borderWidth;
@property (nonatomic,assign) IBInspectable  CGSize shadowOffset;
@property (nonatomic,assign) IBInspectable  CGFloat shadowOpacity;
@property (nonatomic,strong) IBInspectable  UIColor *shadowColor;
@property (nonatomic,strong) IBInspectable  UIColor *borderColor;
@property (nonatomic,assign) IBInspectable  BOOL masksToBounds;
@property (nonatomic,strong) IBInspectable  NSString *bgColor;
@property (nonatomic,strong) IBInspectable  NSString *bgImage;

/**
 *  切某一方向的圆角
 */
-(void)viewCutRoundedOfRectCorner:(UIRectCorner)rectCorner cornerRadii:(CGFloat)cornerRadii;

@end


